﻿using Appliaction.Dto.Sinv;
using Domain.Entitys.Sinv;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Appliaction.IAppServices.Sinv
{
    public interface ISinv_Sale_OutboundService
    {
        /// <summary>
        /// 分页条件查询销售出库信息
        /// </summary>
        /// <param name="currentPage"></param>
        /// <param name="pageSize"></param>
        /// <param name="customerName"></param>
        /// <param name="orderCode"></param>
        /// <returns></returns>
        List<Sinv_Sale_Outbound_Info> GetSinv_Sale_Outbound_Infos(int currentPage, int pageSize, string customerName, string orderCode, int orderStatus, char auditStatus);

        /// <summary>
        /// 条件查询销售出库总数
        /// </summary>
        /// <param name="customerName"></param>
        /// <param name="orderCode"></param>
        /// <returns></returns>
        Task<int> Sinv_Sale_OutboundCountAsync(string customerName, string orderCode, int orderStatus, char auditStatus);

        /// <summary>
        /// 逻辑删除销售出库信息
        /// </summary>
        /// <param name="sinv_CustomerDelDto"></param>
        /// <returns></returns>
        Task<int> Sinv_Sale_OutboundDelAsync(Sinv_Sale_OutboundDelDto sinv_CustomerDelDto);

        /// <summary>
        /// 添加销售出库信息及其详情
        /// </summary>
        /// <param name="saleOutboundWithDetailsDto"></param>
        /// <returns></returns>
        Task<int> Sinv_Sale_OutboundAddAsync(SaleOutboundWithDetailsDto<Sinv_Sale_OutboundAddDto> saleOutboundWithDetailsDto);

        /// <summary>
        /// 根据销售出库编号查询对应销售订单信息
        /// </summary>
        /// <param name="code"></param>
        /// <returns></returns>
        Task<Sinv_Sale_Outbound> GetSinv_Sale_OutboundByCodeAsync(string code);

        /// <summary>
        /// 根据销售出库编号查询销售出库明细
        /// </summary>
        /// <param name="code"></param>
        /// <returns></returns>
        Task<List<Sinv_Sale_Outbound_Details>> GetSinv_Sale_Outbound_DetailsByCodeAsync(string code);

        /// <summary>
        /// 修改销售出库订单及其详情
        /// </summary>
        /// <param name="saleOutboundWithDetailsUpdateDto"></param>
        /// <returns></returns>
        Task<int> Sinv_Sale_OutboundUpdateAsync(SaleOutboundWithDetailsUpdateDto saleOutboundWithDetailsDto);

        /// <summary>
        /// 修改销售出库信息审核状态，减少库存，增加销售明细出库数量，修改销售订单出库状态
        /// </summary>
        /// <param name="sinv_Sale_Outbound"></param>
        /// <returns></returns>
        Task<int> Sinv_Sale_OutboundAuditUpdateAsync(Sinv_Sale_OutboundAuditUpdateDto sinv_Sale_Outbound);

    }
}
